package com.pavelkaminsky;

import java.io.IOException;
import java.util.Properties;

/**
 * @Author: Pavel Kaminsky
 * @Site : www.pavel-kaminsky.com
 * @Date: 08/10/11
 */

public class ApplicationProperties {

    private static ApplicationProperties ourInstance = new ApplicationProperties();
    private Properties properties;

    public static ApplicationProperties getInstance() {
        return ourInstance;
    }

    private ApplicationProperties() {
        properties = new Properties();
        try {
            properties.load(Main.class.getClassLoader().getResourceAsStream("settings.properties"));
        } catch (IOException e) {
            System.out.println("can't load properties file please put it in calss path, exiting..");
            System.exit(1);
        }
    }

    public String getProperty(String key) {
        return properties.getProperty(key);
    }
}
